home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / RemoteCall.java < prev    next >
Text File  |  1998-09-22  |  3KB  |  89 lines

  1. /*
  2.  * @(#)RemoteCall.java    1.7 98/07/01
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.rmi.server;
  16. import java.rmi.*;
  17. import java.io.ObjectOutput;
  18. import java.io.ObjectInput;
  19. import java.io.StreamCorruptedException;
  20. import java.io.IOException;
  21.  
  22. /**
  23.  * RemoteCall is an abstraction used solely by the implementation
  24.  * (stubs and skeletons of remote objects) to carry out a call to a
  25.  * remote object.
  26.  */
  27. public interface RemoteCall {
  28.  
  29.     /**
  30.      * Return the output stream the stub/skeleton should put arguments/results
  31.      * into.
  32.      *
  33.      * @exception java.io.IOException if an I/O error occurs.
  34.      */
  35.     ObjectOutput getOutputStream()  throws IOException;
  36.     
  37.     /**
  38.      * Release the output stream; in some transports this would release
  39.      * the stream.
  40.      *
  41.      * @exception java.io.IOException if an I/O error occurs.
  42.      */
  43.     void releaseOutputStream()  throws IOException;
  44.  
  45.     /**
  46.      * Get the InputStream that the stub/skeleton should get
  47.      * results/arguments from.
  48.      *
  49.      * @exception java.io.IOException if an I/O error occurs.
  50.      */
  51.     ObjectInput getInputStream()  throws IOException;
  52.  
  53.     
  54.     /**
  55.      * Release the input stream. This would allow some transports to release
  56.      * the channel early.
  57.      *
  58.      * @exception java.io.IOException if an I/O error occurs.
  59.      */
  60.     void releaseInputStream() throws IOException;
  61.  
  62.     /**
  63.      * Returns an output stream (may put out header information
  64.      * relating to the success of the call). Should only succeed
  65.      * once per remote call.
  66.      *
  67.      * @param success If true, indicates normal return, else indicates
  68.      * exceptional return.
  69.      * @exception java.io.IOException              if an I/O error occurs.
  70.      * @exception java.io.StreamCorruptedException If already been called.
  71.      */
  72.     ObjectOutput getResultStream(boolean success) throws IOException,
  73.     StreamCorruptedException;
  74.     
  75.     /**
  76.      * Do whatever it takes to execute the call.
  77.      *
  78.      * @exception java.lang.Exception if a general exception occurs.
  79.      */
  80.     void executeCall() throws Exception;
  81.  
  82.     /**
  83.      * Allow cleanup after the remote call has completed.
  84.      *
  85.      * @exception java.io.IOException if an I/O error occurs.
  86.      */
  87.     void done() throws IOException;
  88. }
  89.